﻿<style>
    .tabs-header-left .tabs li.tabs-selected a.tabs-inner{
        /*padding-top:6px;*/
        border-right-color:#95B8E7;
    }
    .tabs-title{
        line-height:18px;
    }
</style>
<body  class="easyui-layout">   
    <div id="tb1">
        <table cellpadding="0" cellspacing="0" style="width: 100%">
            <tr>
                <td></td>
                <td style="text-align:right">
                    <input class="easyui-searchbox" data-options="prompt:'输入流程名称',searcher:doSearch1 " style="width:200px">
                </td>
            </tr>
        </table>
    </div>
    <div id="tb2">
        <table cellpadding="0" cellspacing="0" style="width: 100%">
            <tr>
                <td></td>
                <td style="text-align:right">
                    <input class="easyui-searchbox" data-options="prompt:'输入流程名称',searcher:doSearch2 " style="width:200px">
                </td>
            </tr>
        </table>
    </div>
    <div data-options="region:'center',border:true">
        <div id="roleTab" class="easyui-tabs" data-options="fit:true,border:false,tabPosition:'left',headerWidth:34,tabHeight:78">
            <div title="待<br>办<br>任<br>务">                
                <table id="dgToDo" class="easyui-datagrid" rownumbers="true" fit="true" pagination="true" fitcolumns="false" striped="true" border="false" idfield="Id"
                       url="gettodolist" autorowheight="false" singleselect="true" toolbar="#tb1">
                    <thead>
                        <tr>
                            <th data-options="field:'ck',checkbox:true"></th>
                            <th field="FlowInstName" width="250" halign='center'>
                                流程名称
                            </th>
                            <th field="CurrentStepName" width="100" halign='center'>
                                当前环节
                            </th>
                            <th field="DefName" width="200" halign='center'>
                                流程定义名称
                            </th>
                            <th field="SendTime" width="100" halign='center' align="center">
                                发送时间
                            </th>
                            <th field="StepUserName" width="100" halign='center' align="center">
                                当前接收人
                            </th>
                            <th field="StepGraph" width="100" halign='center' align="center">
                                流程跟踪
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
            <div title="已<br>办<br>任<br>务">
                <table id="dgDone" class="easyui-datagrid" rownumbers="true" fit="true" pagination="true" fitcolumns="false" striped="true" border="false" idfield="Id"
                       url="getdonelist" autorowheight="false" singleselect="true" toolbar="#tb2">
                    <thead>
                        <tr>
                            <th data-options="field:'ck',checkbox:true"></th>
                            <th field="FlowInstName" width="250" halign='center'>
                                流程名称
                            </th>
                            <th field="StepName" width="100" halign='center'>
                                当前环节
                            </th>
                            <th field="DefName" width="200" halign='center'>
                                流程定义名称
                            </th>
                            <th field="SendTime" width="100" halign='center' align="center">
                                发送时间
                            </th>                            
                            <th field="OperateUserName" width="100" halign='center' align="center">
                                当前处理人
                            </th>
                            <th field="OperateTime" width="100" halign='center' align="center">
                                处理时间
                            </th>
                            <th field="StepGraph" width="100" halign='center' align="center">
                                流程跟踪
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</body>
<script>
    addGridDate('dgToDo', 'SendTime', 'yyyy-MM-dd');

    addGridLink('dgToDo', 'FlowInstName', '/WorkFlow/WFForm/WFPageView', {
        paramField: 'FormInstId', paramUrlField: 'Id',
        height: '70%', width: '80%', onDestroy: function (e) {
            if (e) {
                $("#dgToDo").datagrid('reload');
            }
        }
    });

    addGridLink('dgToDo', 'StepGraph', '/WorkFlow/WFForm/Trace', { paramField: 'FormInstId', paramUrlField: 'Id', linkText: '流程跟踪' });
</script>

<script>
    addGridDate('dgDone', 'SendTime', 'yyyy-MM-dd');
    addGridDate('dgDone', 'OperateTime', 'yyyy-MM-dd');

    addGridLink('dgDone', 'FlowInstName', '/WorkFlow/WFForm/WFPageView?FuncType=View', {
        paramField: 'FormInstId', paramUrlField: 'Id',
        height: '70%', width: '80%', onDestroy: function (e) {
            if (e) {
                $("#dgDone").datagrid('reload');
            }
        }
    });

    addGridLink('dgDone', 'StepGraph', '/WorkFlow/WFForm/Trace', { paramField: 'FormInstId', paramUrlField: 'Id', linkText: '流程跟踪' });

    function doSearch1(value, name) {
        $('#dgToDo').datagrid('load', {
            Name: value
        });
    }
    function doSearch2(value, name) {
        $('#dgDone').datagrid('load', {
            Name: value
        });
    }
</script>